package com.atguigu.gulimall.auth.vo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


/**
 * @author 满超
 * @date 2020/06/17
 * 注册信息
 **/
@Data
public class RegisterVo {

    @NotEmpty(message = "用户名不能为空")
    @Size(max = 18,min = 4,message = "长度只能在4-20个字符之间")
    private String username;

    @NotEmpty(message = "密码必须不为空")
    @Size(max = 18,min = 4,message = "密码长度必须在6到18")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "1([34578])\\d{9}$",message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "验证码不能为空")
    private String code;
}
